3.1.2 \(\int \frac {(A+B x) (a+b x+c x^2)^2}{d+f x^2} \, dx\)

Optimal. Leaf size=228 \[ -\frac {\log \left (d+f x^2\right ) \left (2 A b f (c d-a f)-B \left (-f \left (b^2 d-a^2 f\right )-2 a c d f+c^2 d^2\right )\right )}{2 f^3}+\frac {x^2 \left (2 A b c f-B \left (-2 a c f+b^2 (-f)+c^2 d\right )\right )}{2 f^2}-\frac {\tan ^{-1}\left (\frac {\sqrt {f} x}{\sqrt {d}}\right ) \left (-A (c d-a f)^2-2 b B d (c d-a f)+A b^2 d f\right )}{\sqrt {d} f^{5/2}}+\frac {x \left (-A c (c d-2 a f)-b B (2 c d-2 a f)+A b^2 f\right )}{f^2}+\frac {c x^3 (A c+2 b B)}{3 f}+\frac {B c^2 x^4}{4 f} \]

________________________________________________________________________________________

Rubi [A]  time = 0.33, antiderivative size = 228, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {1012, 635, 205, 260} \begin {gather*} -\frac {\log \left (d+f x^2\right ) \left (2 A b f (c d-a f)-B \left (-f \left (b^2 d-a^2 f\right )-2 a c d f+c^2 d^2\right )\right )}{2 f^3}+\frac {x^2 \left (2 A b c f-B \left (-2 a c f+b^2 (-f)+c^2 d\right )\right )}{2 f^2}+\frac {x \left (-A c (c d-2 a f)-b B (2 c d-2 a f)+A b^2 f\right )}{f^2}-\frac {\tan ^{-1}\left (\frac {\sqrt {f} x}{\sqrt {d}}\right ) \left (-A (c d-a f)^2-2 b B d (c d-a f)+A b^2 d f\right )}{\sqrt {d} f^{5/2}}+\frac {c x^3 (A c+2 b B)}{3 f}+\frac {B c^2 x^4}{4 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((A + B*x)*(a + b*x + c*x^2)^2)/(d + f*x^2),x]

[Out]

((A*b^2*f - A*c*(c*d - 2*a*f) - b*B*(2*c*d - 2*a*f))*x)/f^2 + ((2*A*b*c*f - B*(c^2*d - b^2*f - 2*a*c*f))*x^2)/
(2*f^2) + (c*(2*b*B + A*c)*x^3)/(3*f) + (B*c^2*x^4)/(4*f) - ((A*b^2*d*f - 2*b*B*d*(c*d - a*f) - A*(c*d - a*f)^
2)*ArcTan[(Sqrt[f]*x)/Sqrt[d]])/(Sqrt[d]*f^(5/2)) - ((2*A*b*f*(c*d - a*f) - B*(c^2*d^2 - 2*a*c*d*f - f*(b^2*d
- a^2*f)))*Log[d + f*x^2])/(2*f^3)

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 1012

Int[((g_.) + (h_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_)*((d_) + (e_.)*(x_) + (f_.)*(x_)^2)^(q_), x_Symbol] :> Int[
ExpandIntegrand[(a + c*x^2)^p*(d + e*x + f*x^2)^q*(g + h*x), x], x] /; FreeQ[{a, c, d, e, f, g, h}, x] && NeQ[
e^2 - 4*d*f, 0] && IntegersQ[p, q] && (GtQ[p, 0] || GtQ[q, 0])

Rubi steps

\begin {align*} \int \frac {(A+B x) \left (a+b x+c x^2\right )^2}{d+f x^2} \, dx &=\int \left (\frac {A b^2 f-A c (c d-2 a f)-b B (2 c d-2 a f)}{f^2}+\frac {\left (2 A b c f-B \left (c^2 d-b^2 f-2 a c f\right )\right ) x}{f^2}+\frac {c (2 b B+A c) x^2}{f}+\frac {B c^2 x^3}{f}+\frac {-A b^2 d f+2 b B d (c d-a f)+A (c d-a f)^2-\left (2 A b f (c d-a f)-B \left (c^2 d^2-2 a c d f-f \left (b^2 d-a^2 f\right )\right )\right ) x}{f^2 \left (d+f x^2\right )}\right ) \, dx\\ &=\frac {\left (A b^2 f-A c (c d-2 a f)-b B (2 c d-2 a f)\right ) x}{f^2}+\frac {\left (2 A b c f-B \left (c^2 d-b^2 f-2 a c f\right )\right ) x^2}{2 f^2}+\frac {c (2 b B+A c) x^3}{3 f}+\frac {B c^2 x^4}{4 f}+\frac {\int \frac {-A b^2 d f+2 b B d (c d-a f)+A (c d-a f)^2-\left (2 A b f (c d-a f)-B \left (c^2 d^2-2 a c d f-f \left (b^2 d-a^2 f\right )\right )\right ) x}{d+f x^2} \, dx}{f^2}\\ &=\frac {\left (A b^2 f-A c (c d-2 a f)-b B (2 c d-2 a f)\right ) x}{f^2}+\frac {\left (2 A b c f-B \left (c^2 d-b^2 f-2 a c f\right )\right ) x^2}{2 f^2}+\frac {c (2 b B+A c) x^3}{3 f}+\frac {B c^2 x^4}{4 f}-\frac {\left (A b^2 d f-2 b B d (c d-a f)-A (c d-a f)^2\right ) \int \frac {1}{d+f x^2} \, dx}{f^2}-\frac {\left (2 A b f (c d-a f)-B \left (c^2 d^2-2 a c d f-f \left (b^2 d-a^2 f\right )\right )\right ) \int \frac {x}{d+f x^2} \, dx}{f^2}\\ &=\frac {\left (A b^2 f-A c (c d-2 a f)-b B (2 c d-2 a f)\right ) x}{f^2}+\frac {\left (2 A b c f-B \left (c^2 d-b^2 f-2 a c f\right )\right ) x^2}{2 f^2}+\frac {c (2 b B+A c) x^3}{3 f}+\frac {B c^2 x^4}{4 f}-\frac {\left (A b^2 d f-2 b B d (c d-a f)-A (c d-a f)^2\right ) \tan ^{-1}\left (\frac {\sqrt {f} x}{\sqrt {d}}\right )}{\sqrt {d} f^{5/2}}-\frac {\left (2 A b f (c d-a f)-B \left (c^2 d^2-2 a c d f-f \left (b^2 d-a^2 f\right )\right )\right ) \log \left (d+f x^2\right )}{2 f^3}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.20, size = 204, normalized size = 0.89 \begin {gather*} \frac {6 \log \left (d+f x^2\right ) \left (B \left (a^2 f^2-2 a c d f+b^2 (-d) f+c^2 d^2\right )+2 A b f (a f-c d)\right )+f x \left (4 A c \left (6 a f-3 c d+c f x^2\right )+4 b B \left (6 a f-6 c d+2 c f x^2\right )+3 B c x \left (4 a f-2 c d+c f x^2\right )+6 b^2 f (2 A+B x)+12 A b c f x\right )}{12 f^3}+\frac {\tan ^{-1}\left (\frac {\sqrt {f} x}{\sqrt {d}}\right ) \left (A (c d-a f)^2+2 b B d (c d-a f)-A b^2 d f\right )}{\sqrt {d} f^{5/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((A + B*x)*(a + b*x + c*x^2)^2)/(d + f*x^2),x]

[Out]

((-(A*b^2*d*f) + 2*b*B*d*(c*d - a*f) + A*(c*d - a*f)^2)*ArcTan[(Sqrt[f]*x)/Sqrt[d]])/(Sqrt[d]*f^(5/2)) + (f*x*
(12*A*b*c*f*x + 6*b^2*f*(2*A + B*x) + 3*B*c*x*(-2*c*d + 4*a*f + c*f*x^2) + 4*A*c*(-3*c*d + 6*a*f + c*f*x^2) +
4*b*B*(-6*c*d + 6*a*f + 2*c*f*x^2)) + 6*(2*A*b*f*(-(c*d) + a*f) + B*(c^2*d^2 - b^2*d*f - 2*a*c*d*f + a^2*f^2))
*Log[d + f*x^2])/(12*f^3)

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(A+B x) \left (a+b x+c x^2\right )^2}{d+f x^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[((A + B*x)*(a + b*x + c*x^2)^2)/(d + f*x^2),x]

[Out]

IntegrateAlgebraic[((A + B*x)*(a + b*x + c*x^2)^2)/(d + f*x^2), x]

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 500, normalized size = 2.19 \begin {gather*} \left [\frac {3 \, B c^{2} d f^{2} x^{4} + 4 \, {\left (2 \, B b c + A c^{2}\right )} d f^{2} x^{3} - 6 \, {\left (B c^{2} d^{2} f - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} d f^{2}\right )} x^{2} - 6 \, {\left (A a^{2} f^{2} + {\left (2 \, B b c + A c^{2}\right )} d^{2} - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} d f\right )} \sqrt {-d f} \log \left (\frac {f x^{2} - 2 \, \sqrt {-d f} x - d}{f x^{2} + d}\right ) - 12 \, {\left ({\left (2 \, B b c + A c^{2}\right )} d^{2} f - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} d f^{2}\right )} x + 6 \, {\left (B c^{2} d^{3} - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} d^{2} f + {\left (B a^{2} + 2 \, A a b\right )} d f^{2}\right )} \log \left (f x^{2} + d\right )}{12 \, d f^{3}}, \frac {3 \, B c^{2} d f^{2} x^{4} + 4 \, {\left (2 \, B b c + A c^{2}\right )} d f^{2} x^{3} - 6 \, {\left (B c^{2} d^{2} f - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} d f^{2}\right )} x^{2} + 12 \, {\left (A a^{2} f^{2} + {\left (2 \, B b c + A c^{2}\right )} d^{2} - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} d f\right )} \sqrt {d f} \arctan \left (\frac {\sqrt {d f} x}{d}\right ) - 12 \, {\left ({\left (2 \, B b c + A c^{2}\right )} d^{2} f - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} d f^{2}\right )} x + 6 \, {\left (B c^{2} d^{3} - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} d^{2} f + {\left (B a^{2} + 2 \, A a b\right )} d f^{2}\right )} \log \left (f x^{2} + d\right )}{12 \, d f^{3}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+d),x, algorithm="fricas")

[Out]

[1/12*(3*B*c^2*d*f^2*x^4 + 4*(2*B*b*c + A*c^2)*d*f^2*x^3 - 6*(B*c^2*d^2*f - (B*b^2 + 2*(B*a + A*b)*c)*d*f^2)*x
^2 - 6*(A*a^2*f^2 + (2*B*b*c + A*c^2)*d^2 - (2*B*a*b + A*b^2 + 2*A*a*c)*d*f)*sqrt(-d*f)*log((f*x^2 - 2*sqrt(-d
*f)*x - d)/(f*x^2 + d)) - 12*((2*B*b*c + A*c^2)*d^2*f - (2*B*a*b + A*b^2 + 2*A*a*c)*d*f^2)*x + 6*(B*c^2*d^3 -
(B*b^2 + 2*(B*a + A*b)*c)*d^2*f + (B*a^2 + 2*A*a*b)*d*f^2)*log(f*x^2 + d))/(d*f^3), 1/12*(3*B*c^2*d*f^2*x^4 +
4*(2*B*b*c + A*c^2)*d*f^2*x^3 - 6*(B*c^2*d^2*f - (B*b^2 + 2*(B*a + A*b)*c)*d*f^2)*x^2 + 12*(A*a^2*f^2 + (2*B*b
*c + A*c^2)*d^2 - (2*B*a*b + A*b^2 + 2*A*a*c)*d*f)*sqrt(d*f)*arctan(sqrt(d*f)*x/d) - 12*((2*B*b*c + A*c^2)*d^2
*f - (2*B*a*b + A*b^2 + 2*A*a*c)*d*f^2)*x + 6*(B*c^2*d^3 - (B*b^2 + 2*(B*a + A*b)*c)*d^2*f + (B*a^2 + 2*A*a*b)
*d*f^2)*log(f*x^2 + d))/(d*f^3)]

________________________________________________________________________________________

giac [A]  time = 0.16, size = 263, normalized size = 1.15 \begin {gather*} \frac {{\left (2 \, B b c d^{2} + A c^{2} d^{2} - 2 \, B a b d f - A b^{2} d f - 2 \, A a c d f + A a^{2} f^{2}\right )} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f} f^{2}} + \frac {{\left (B c^{2} d^{2} - B b^{2} d f - 2 \, B a c d f - 2 \, A b c d f + B a^{2} f^{2} + 2 \, A a b f^{2}\right )} \log \left (f x^{2} + d\right )}{2 \, f^{3}} + \frac {3 \, B c^{2} f^{3} x^{4} + 8 \, B b c f^{3} x^{3} + 4 \, A c^{2} f^{3} x^{3} - 6 \, B c^{2} d f^{2} x^{2} + 6 \, B b^{2} f^{3} x^{2} + 12 \, B a c f^{3} x^{2} + 12 \, A b c f^{3} x^{2} - 24 \, B b c d f^{2} x - 12 \, A c^{2} d f^{2} x + 24 \, B a b f^{3} x + 12 \, A b^{2} f^{3} x + 24 \, A a c f^{3} x}{12 \, f^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+d),x, algorithm="giac")

[Out]

(2*B*b*c*d^2 + A*c^2*d^2 - 2*B*a*b*d*f - A*b^2*d*f - 2*A*a*c*d*f + A*a^2*f^2)*arctan(f*x/sqrt(d*f))/(sqrt(d*f)
*f^2) + 1/2*(B*c^2*d^2 - B*b^2*d*f - 2*B*a*c*d*f - 2*A*b*c*d*f + B*a^2*f^2 + 2*A*a*b*f^2)*log(f*x^2 + d)/f^3 +
 1/12*(3*B*c^2*f^3*x^4 + 8*B*b*c*f^3*x^3 + 4*A*c^2*f^3*x^3 - 6*B*c^2*d*f^2*x^2 + 6*B*b^2*f^3*x^2 + 12*B*a*c*f^
3*x^2 + 12*A*b*c*f^3*x^2 - 24*B*b*c*d*f^2*x - 12*A*c^2*d*f^2*x + 24*B*a*b*f^3*x + 12*A*b^2*f^3*x + 24*A*a*c*f^
3*x)/f^4

________________________________________________________________________________________

maple [A]  time = 0.01, size = 373, normalized size = 1.64 \begin {gather*} \frac {B \,c^{2} x^{4}}{4 f}+\frac {A \,c^{2} x^{3}}{3 f}+\frac {2 B b c \,x^{3}}{3 f}+\frac {A \,a^{2} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}}-\frac {2 A a c d \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f}-\frac {A \,b^{2} d \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f}+\frac {A b c \,x^{2}}{f}+\frac {A \,c^{2} d^{2} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f^{2}}-\frac {2 B a b d \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f}+\frac {B a c \,x^{2}}{f}+\frac {B \,b^{2} x^{2}}{2 f}+\frac {2 B b c \,d^{2} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f}\, f^{2}}-\frac {B \,c^{2} d \,x^{2}}{2 f^{2}}+\frac {A a b \ln \left (f \,x^{2}+d \right )}{f}+\frac {2 A a c x}{f}+\frac {A \,b^{2} x}{f}-\frac {A b c d \ln \left (f \,x^{2}+d \right )}{f^{2}}-\frac {A \,c^{2} d x}{f^{2}}+\frac {B \,a^{2} \ln \left (f \,x^{2}+d \right )}{2 f}+\frac {2 B a b x}{f}-\frac {B a c d \ln \left (f \,x^{2}+d \right )}{f^{2}}-\frac {B \,b^{2} d \ln \left (f \,x^{2}+d \right )}{2 f^{2}}-\frac {2 B b c d x}{f^{2}}+\frac {B \,c^{2} d^{2} \ln \left (f \,x^{2}+d \right )}{2 f^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+d),x)

[Out]

1/4*B*c^2*x^4/f+1/3/f*A*x^3*c^2+2/3/f*B*x^3*b*c+1/f*A*x^2*b*c+1/f*B*x^2*a*c+1/2/f*B*x^2*b^2-1/2/f^2*B*x^2*c^2*
d+2/f*A*a*c*x+1/f*A*b^2*x-1/f^2*A*c^2*d*x+2/f*B*a*b*x-2/f^2*B*b*c*d*x+1/f*ln(f*x^2+d)*A*a*b-1/f^2*ln(f*x^2+d)*
A*b*c*d+1/2/f*ln(f*x^2+d)*B*a^2-1/f^2*ln(f*x^2+d)*B*a*c*d-1/2/f^2*ln(f*x^2+d)*B*b^2*d+1/2/f^3*ln(f*x^2+d)*B*c^
2*d^2+1/(d*f)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*A*a^2-2/f/(d*f)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*A*a*c*d-1/f/(d*f
)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*A*b^2*d+1/f^2/(d*f)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*A*c^2*d^2-2/f/(d*f)^(1/2
)*arctan(1/(d*f)^(1/2)*f*x)*B*a*b*d+2/f^2/(d*f)^(1/2)*arctan(1/(d*f)^(1/2)*f*x)*B*b*c*d^2

________________________________________________________________________________________

maxima [A]  time = 0.98, size = 220, normalized size = 0.96 \begin {gather*} \frac {{\left (A a^{2} f^{2} + {\left (2 \, B b c + A c^{2}\right )} d^{2} - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} d f\right )} \arctan \left (\frac {f x}{\sqrt {d f}}\right )}{\sqrt {d f} f^{2}} + \frac {3 \, B c^{2} f x^{4} + 4 \, {\left (2 \, B b c + A c^{2}\right )} f x^{3} - 6 \, {\left (B c^{2} d - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} f\right )} x^{2} - 12 \, {\left ({\left (2 \, B b c + A c^{2}\right )} d - {\left (2 \, B a b + A b^{2} + 2 \, A a c\right )} f\right )} x}{12 \, f^{2}} + \frac {{\left (B c^{2} d^{2} - {\left (B b^{2} + 2 \, {\left (B a + A b\right )} c\right )} d f + {\left (B a^{2} + 2 \, A a b\right )} f^{2}\right )} \log \left (f x^{2} + d\right )}{2 \, f^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+d),x, algorithm="maxima")

[Out]

(A*a^2*f^2 + (2*B*b*c + A*c^2)*d^2 - (2*B*a*b + A*b^2 + 2*A*a*c)*d*f)*arctan(f*x/sqrt(d*f))/(sqrt(d*f)*f^2) +
1/12*(3*B*c^2*f*x^4 + 4*(2*B*b*c + A*c^2)*f*x^3 - 6*(B*c^2*d - (B*b^2 + 2*(B*a + A*b)*c)*f)*x^2 - 12*((2*B*b*c
 + A*c^2)*d - (2*B*a*b + A*b^2 + 2*A*a*c)*f)*x)/f^2 + 1/2*(B*c^2*d^2 - (B*b^2 + 2*(B*a + A*b)*c)*d*f + (B*a^2
+ 2*A*a*b)*f^2)*log(f*x^2 + d)/f^3

________________________________________________________________________________________

mupad [B]  time = 0.25, size = 253, normalized size = 1.11 \begin {gather*} x\,\left (\frac {A\,b^2+2\,B\,a\,b+2\,A\,a\,c}{f}-\frac {d\,\left (A\,c^2+2\,B\,b\,c\right )}{f^2}\right )+x^2\,\left (\frac {B\,b^2+2\,A\,c\,b+2\,B\,a\,c}{2\,f}-\frac {B\,c^2\,d}{2\,f^2}\right )+\frac {x^3\,\left (A\,c^2+2\,B\,b\,c\right )}{3\,f}+\frac {B\,c^2\,x^4}{4\,f}+\frac {\mathrm {atan}\left (\frac {\sqrt {f}\,x}{\sqrt {d}}\right )\,\left (A\,a^2\,f^2-2\,B\,a\,b\,d\,f-2\,A\,a\,c\,d\,f-A\,b^2\,d\,f+2\,B\,b\,c\,d^2+A\,c^2\,d^2\right )}{\sqrt {d}\,f^{5/2}}+\frac {\ln \left (f\,x^2+d\right )\,\left (4\,B\,a^2\,d\,f^5+8\,A\,a\,b\,d\,f^5-8\,B\,a\,c\,d^2\,f^4-4\,B\,b^2\,d^2\,f^4-8\,A\,b\,c\,d^2\,f^4+4\,B\,c^2\,d^3\,f^3\right )}{8\,d\,f^6} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(a + b*x + c*x^2)^2)/(d + f*x^2),x)

[Out]

x*((A*b^2 + 2*A*a*c + 2*B*a*b)/f - (d*(A*c^2 + 2*B*b*c))/f^2) + x^2*((B*b^2 + 2*A*b*c + 2*B*a*c)/(2*f) - (B*c^
2*d)/(2*f^2)) + (x^3*(A*c^2 + 2*B*b*c))/(3*f) + (B*c^2*x^4)/(4*f) + (atan((f^(1/2)*x)/d^(1/2))*(A*a^2*f^2 + A*
c^2*d^2 + 2*B*b*c*d^2 - A*b^2*d*f - 2*A*a*c*d*f - 2*B*a*b*d*f))/(d^(1/2)*f^(5/2)) + (log(d + f*x^2)*(4*B*a^2*d
*f^5 - 4*B*b^2*d^2*f^4 + 4*B*c^2*d^3*f^3 + 8*A*a*b*d*f^5 - 8*A*b*c*d^2*f^4 - 8*B*a*c*d^2*f^4))/(8*d*f^6)

________________________________________________________________________________________

sympy [B]  time = 7.87, size = 933, normalized size = 4.09 \begin {gather*} \frac {B c^{2} x^{4}}{4 f} + x^{3} \left (\frac {A c^{2}}{3 f} + \frac {2 B b c}{3 f}\right ) + x^{2} \left (\frac {A b c}{f} + \frac {B a c}{f} + \frac {B b^{2}}{2 f} - \frac {B c^{2} d}{2 f^{2}}\right ) + x \left (\frac {2 A a c}{f} + \frac {A b^{2}}{f} - \frac {A c^{2} d}{f^{2}} + \frac {2 B a b}{f} - \frac {2 B b c d}{f^{2}}\right ) + \left (\frac {2 A a b f^{2} - 2 A b c d f + B a^{2} f^{2} - 2 B a c d f - B b^{2} d f + B c^{2} d^{2}}{2 f^{3}} - \frac {\sqrt {- d f^{7}} \left (A a^{2} f^{2} - 2 A a c d f - A b^{2} d f + A c^{2} d^{2} - 2 B a b d f + 2 B b c d^{2}\right )}{2 d f^{6}}\right ) \log {\left (x + \frac {- 2 A a b d f^{2} + 2 A b c d^{2} f - B a^{2} d f^{2} + 2 B a c d^{2} f + B b^{2} d^{2} f - B c^{2} d^{3} + 2 d f^{3} \left (\frac {2 A a b f^{2} - 2 A b c d f + B a^{2} f^{2} - 2 B a c d f - B b^{2} d f + B c^{2} d^{2}}{2 f^{3}} - \frac {\sqrt {- d f^{7}} \left (A a^{2} f^{2} - 2 A a c d f - A b^{2} d f + A c^{2} d^{2} - 2 B a b d f + 2 B b c d^{2}\right )}{2 d f^{6}}\right )}{A a^{2} f^{3} - 2 A a c d f^{2} - A b^{2} d f^{2} + A c^{2} d^{2} f - 2 B a b d f^{2} + 2 B b c d^{2} f} \right )} + \left (\frac {2 A a b f^{2} - 2 A b c d f + B a^{2} f^{2} - 2 B a c d f - B b^{2} d f + B c^{2} d^{2}}{2 f^{3}} + \frac {\sqrt {- d f^{7}} \left (A a^{2} f^{2} - 2 A a c d f - A b^{2} d f + A c^{2} d^{2} - 2 B a b d f + 2 B b c d^{2}\right )}{2 d f^{6}}\right ) \log {\left (x + \frac {- 2 A a b d f^{2} + 2 A b c d^{2} f - B a^{2} d f^{2} + 2 B a c d^{2} f + B b^{2} d^{2} f - B c^{2} d^{3} + 2 d f^{3} \left (\frac {2 A a b f^{2} - 2 A b c d f + B a^{2} f^{2} - 2 B a c d f - B b^{2} d f + B c^{2} d^{2}}{2 f^{3}} + \frac {\sqrt {- d f^{7}} \left (A a^{2} f^{2} - 2 A a c d f - A b^{2} d f + A c^{2} d^{2} - 2 B a b d f + 2 B b c d^{2}\right )}{2 d f^{6}}\right )}{A a^{2} f^{3} - 2 A a c d f^{2} - A b^{2} d f^{2} + A c^{2} d^{2} f - 2 B a b d f^{2} + 2 B b c d^{2} f} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x**2+b*x+a)**2/(f*x**2+d),x)

[Out]

B*c**2*x**4/(4*f) + x**3*(A*c**2/(3*f) + 2*B*b*c/(3*f)) + x**2*(A*b*c/f + B*a*c/f + B*b**2/(2*f) - B*c**2*d/(2
*f**2)) + x*(2*A*a*c/f + A*b**2/f - A*c**2*d/f**2 + 2*B*a*b/f - 2*B*b*c*d/f**2) + ((2*A*a*b*f**2 - 2*A*b*c*d*f
 + B*a**2*f**2 - 2*B*a*c*d*f - B*b**2*d*f + B*c**2*d**2)/(2*f**3) - sqrt(-d*f**7)*(A*a**2*f**2 - 2*A*a*c*d*f -
 A*b**2*d*f + A*c**2*d**2 - 2*B*a*b*d*f + 2*B*b*c*d**2)/(2*d*f**6))*log(x + (-2*A*a*b*d*f**2 + 2*A*b*c*d**2*f
- B*a**2*d*f**2 + 2*B*a*c*d**2*f + B*b**2*d**2*f - B*c**2*d**3 + 2*d*f**3*((2*A*a*b*f**2 - 2*A*b*c*d*f + B*a**
2*f**2 - 2*B*a*c*d*f - B*b**2*d*f + B*c**2*d**2)/(2*f**3) - sqrt(-d*f**7)*(A*a**2*f**2 - 2*A*a*c*d*f - A*b**2*
d*f + A*c**2*d**2 - 2*B*a*b*d*f + 2*B*b*c*d**2)/(2*d*f**6)))/(A*a**2*f**3 - 2*A*a*c*d*f**2 - A*b**2*d*f**2 + A
*c**2*d**2*f - 2*B*a*b*d*f**2 + 2*B*b*c*d**2*f)) + ((2*A*a*b*f**2 - 2*A*b*c*d*f + B*a**2*f**2 - 2*B*a*c*d*f -
B*b**2*d*f + B*c**2*d**2)/(2*f**3) + sqrt(-d*f**7)*(A*a**2*f**2 - 2*A*a*c*d*f - A*b**2*d*f + A*c**2*d**2 - 2*B
*a*b*d*f + 2*B*b*c*d**2)/(2*d*f**6))*log(x + (-2*A*a*b*d*f**2 + 2*A*b*c*d**2*f - B*a**2*d*f**2 + 2*B*a*c*d**2*
f + B*b**2*d**2*f - B*c**2*d**3 + 2*d*f**3*((2*A*a*b*f**2 - 2*A*b*c*d*f + B*a**2*f**2 - 2*B*a*c*d*f - B*b**2*d
*f + B*c**2*d**2)/(2*f**3) + sqrt(-d*f**7)*(A*a**2*f**2 - 2*A*a*c*d*f - A*b**2*d*f + A*c**2*d**2 - 2*B*a*b*d*f
 + 2*B*b*c*d**2)/(2*d*f**6)))/(A*a**2*f**3 - 2*A*a*c*d*f**2 - A*b**2*d*f**2 + A*c**2*d**2*f - 2*B*a*b*d*f**2 +
 2*B*b*c*d**2*f))

________________________________________________________________________________________